<template>
  <div id="openpay" class="open-pay" style="width:100%"></div>
</template>

<script>
export default {
  name: "go-pay",
  data() {
    return {};
  },
  methods: {
    createPay() {
      if (this.$store.state.Counter.payStr) {
        let payDom = this.$store.state.Counter.payStr;
        let obj = document.createElement("div");
        let script = document.createElement("script");
        obj.innerHTML = payDom;
        script.innerHTML = payDom.split("<script>")[1].slice(0, -10);
        document.getElementById("openpay").appendChild(obj);
        document.getElementById("openpay").appendChild(script);
      }
    },
  },
  mounted() {
    setTimeout(() => {
      this.createPay();
    }, 1000);
  },
};
</script>

<style>
</style>